﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GrewalCRM.Entities;

namespace GrewalCRM.Entities
{
  public class  CallLog : BaseEntitiesGrewalCRM
	{
		#region Members				
        private DateTime? callReceiveDate;		
        private ReffCallType callType;
        private DealersMaster dealer;		
        private CustomersMaster customer;
        private ReffStatus callStatus;
        private bool? isTempClosed;
        private DateTime? callScheduledDate;		
        private InstallersMaster installer;			
        private DateTime? callCompletedDate;
        private ACBrands aCBrand;
        private DateTime? aCParchasedDate;
        private string aCModelNo;
        private string aCSerialNo;
        private string remarks;
        private string comment;
        private decimal? installerCommisionCR;
        private decimal? installerMaterialCR;
        private decimal? installerAcDR;
        private decimal? dealerAcDR;
        private decimal? dealerAcCR;
        private decimal? dealerDipositCR;
        private decimal? simranAcCR;
        private decimal? simranAcDR;
        private decimal? simranMarginCR;
		#endregion
			
		#region Constructors
		/// <summary>
		/// Create a new instance using the default constructor
		/// </summary>
		public CallLog():base()
		{
      callType = new ReffCallType();
      dealer = new DealersMaster();
      customer=new CustomersMaster();
      callStatus = new ReffStatus();
      installer = new InstallersMaster();
		}

		/// <summary> 
		/// Create a new object using the minimum required information (all not-null fields except 
		/// auto-generated primary keys). 
		/// </summary> 
    public CallLog(DateTime callReceiveDate, ReffCallType callType, DealersMaster dealer, CustomersMaster Customer, ACBrands aCBrand, DateTime? aCParchasedDate, 
      string aCModel, string aCSerialNo, ReffStatus callStatus, UserCRM lastModifiedUser)
      : base(lastModifiedUser)
		{						
			this.callReceiveDate = callReceiveDate;
      this.callType = callType;
      this.dealer = dealer;
      this.customer = Customer;
			this.aCBrand = aCBrand;
			this.aCParchasedDate = aCParchasedDate;
			this.aCModelNo = aCModel;
			this.aCSerialNo = aCSerialNo;
      this.callStatus = callStatus;
		}

		/// <summary> 
		/// Create a new object by specifying all fields (except the auto-generated primary key field). 
		/// </summary> 
    public CallLog(DateTime callReceiveDate, ReffCallType callType, DealersMaster dealer, CustomersMaster Customer, DateTime? callScheduledDate,
                    InstallersMaster installer, DateTime? callCompletedDate, string remarks,string comment, ReffStatus callStatus, ACBrands aCBrand, DateTime? aCParchasedDate,
                    string aCModel, string aCSerialNo, bool? isTempClosed, decimal? installerCommisionCR, decimal? installerMaterialCR, decimal? installerAcDR, 
                    decimal? dealerAcDR, decimal? dealerAcCR, decimal? dealerDipositCR, decimal? simranAcCR, decimal? simranAcDR, decimal? simranMarginCR, 
                    UserCRM lastModifiedUser)
      : base(lastModifiedUser) 
		{						
            this.callReceiveDate = callReceiveDate;
            this.callType = callType;
            this.dealer = dealer;
            this.customer = Customer;
            this.callScheduledDate = callScheduledDate;
            this.installer = installer;			
            this.callCompletedDate = callCompletedDate;
            this.remarks = remarks;
            this.comment = comment;
            this.callStatus = callStatus;
            this.aCBrand = aCBrand;
            this.aCParchasedDate = aCParchasedDate;
            this.aCModelNo = aCModel;
            this.aCSerialNo = aCSerialNo;
            this.isTempClosed = isTempClosed;
            this.installerCommisionCR = installerCommisionCR;
            this.installerMaterialCR = installerMaterialCR;
            this.installerAcDR = installerAcDR;      
            this.dealerAcDR = dealerAcDR;
            this.dealerAcCR = dealerAcCR;
            this.dealerDipositCR = dealerDipositCR;
            this.simranAcCR = simranAcCR;
            this.simranAcDR = simranAcDR;
            this.simranMarginCR = simranMarginCR;
		}
			
		/// <summary> 
		/// Create an object from an existing row of data. This will be used by Gentle to 
		/// construct objects from retrieved rows. 
		/// </summary> 
    public CallLog(int callID, DateTime? callReceiveDate, ReffCallType callType, DealersMaster dealer, CustomersMaster Customer, DateTime? callScheduledDate,
                    InstallersMaster installer, DateTime? callCompletedDate, string remarks,string comment, ReffStatus callStatus, ACBrands aCBrand, DateTime? aCParchasedDate,
                    string aCModel, string aCSerialNo, bool? isTempClosed, decimal? installerCommisionCR, decimal? installerMaterialCR, decimal? installerAcDR, 
                    decimal? dealerAcDR, decimal? dealerAcCR, decimal? dealerDipositCR, decimal? simranAcCR, decimal? simranAcDR, decimal? simranMarginCR, 
                    UserCRM lastModifiedUser, DateTime? lastModifiedDateTime)
      : base(callID, lastModifiedUser, lastModifiedDateTime) 
		{						
            this.callReceiveDate = callReceiveDate;
            this.callType = callType;
            this.dealer = dealer;
            this.customer = Customer;
            this.callScheduledDate = callScheduledDate;
            this.installer = installer;
            this.callCompletedDate = callCompletedDate;
            this.remarks = remarks;
            this.comment = comment;
            this.callStatus = callStatus;
            this.aCBrand = aCBrand;
            this.aCParchasedDate = aCParchasedDate;
            this.aCModelNo = aCModel;
            this.aCSerialNo = aCSerialNo;
            this.isTempClosed = isTempClosed;
            this.installerCommisionCR = installerCommisionCR;
            this.installerMaterialCR = installerMaterialCR;
            this.installerAcDR = installerAcDR;
            this.dealerAcDR = dealerAcDR;
            this.dealerAcCR = dealerAcCR;
            this.dealerDipositCR = dealerDipositCR;
            this.simranAcCR = simranAcCR;
            this.simranAcDR = simranAcDR;
            this.simranMarginCR = simranMarginCR;
		}
		#endregion

    #region Public Properties    
   
    /// <summary>
    /// Property relating to database column CallReceiveDate
    /// </summary>    
    public DateTime? CallReceiveDate
    {
      get { return callReceiveDate; }
      set { IsChanged |= callReceiveDate != value; callReceiveDate = value; }
    }

    /// <summary>
    /// Property relating to database column CallTypeID
    /// </summary>    
    public ReffCallType CallType
    {
      get { return callType; }
      set { IsChanged |= callType.ID != value.ID; callType = value; }
    }

    /// <summary>
    /// Property relating to database column DealerID
    /// </summary>    
    public DealersMaster Dealer
    {
      get { return dealer; }
      set { IsChanged |= dealer.ID != value.ID; dealer = value; }
    }

    /// <summary>
    /// Property relating to database column CallBookedDate
    /// </summary>    
    public DateTime? CallScheduledDate
    {
      get { return callScheduledDate; }
      set { IsChanged |= callScheduledDate != value; callScheduledDate = value; }
    }

    /// <summary>
    /// Property relating to database column InstallerID
    /// </summary>    
    public InstallersMaster Installer
    {
      get { return installer; }
      set { IsChanged |= installer.ID != value.ID; installer = value; }
    }
    

    /// <summary>
    /// Property relating to database column CallCompletedDate
    /// </summary>    
    public DateTime? CallCompletedDate
    {
      get { return callCompletedDate; }
      set { IsChanged |= callCompletedDate != value; callCompletedDate = value; }
    }

    /// <summary>
    /// Property relating to database column Remarks
    /// </summary>    
    public string Remarks
    {
      get { return remarks; }
      set { IsChanged |= remarks != value; remarks = value; }
    }

    /// <summary>
    /// Property relating to database column Comment
    /// </summary>    
    public string Comment
    {
        get { return comment; }
        set { IsChanged |= comment != value; comment = value; }
    }

    // <summary>
    /// Property relating to database column Customer
    /// </summary>    
    public CustomersMaster Customer
    {
      get { return customer; }
      set { IsChanged |= customer.ID != value.ID; customer = value; }
    }

    // <summary>
    /// Property relating to database column Customer
    /// </summary>    
    public ReffStatus CallStatus
    {
      get { return callStatus; }
      set { IsChanged |= callStatus.ID != value.ID; callStatus = value; }
    }

    public bool? IsTempClosed
    {
      get { return isTempClosed; }
      set { IsChanged |= isTempClosed != value; isTempClosed = value; }
    }

    /// <summary>
    /// Property relating to database column ACBrand
    /// </summary>    
    public ACBrands ACBrand
    {
      get { return aCBrand; }
      set { IsChanged |= aCBrand.ID != value.ID; aCBrand = value; }
    }

    /// <summary>
    /// Property relating to database column ACParchasedDate
    /// </summary>    
    public DateTime? ACPurchasedDate
    {
      get { return aCParchasedDate; }
      set { IsChanged |= aCParchasedDate != value; aCParchasedDate = value; }
    }

    /// <summary>
    /// Property relating to database column ACModel
    /// </summary>    
    public string ACModelNo
    {
      get { return aCModelNo; }
      set { IsChanged |= aCModelNo != value; aCModelNo = value; }
    }

    /// <summary>
    /// Property relating to database column ACSerialNo
    /// </summary>    
    public string ACSerialNo
    {
      get { return aCSerialNo; }
      set { IsChanged |= aCSerialNo != value; aCSerialNo = value; }
    }    

    /// <summary>
    /// Property relating to database column InstallerCommisionCR
    /// </summary>
    public decimal? InstallerCommisionCR
    {
      get { return installerCommisionCR; }
      set { IsChanged |= installerCommisionCR != value; installerCommisionCR = value; }
    }

    /// <summary>
    /// Property relating to database column InstallerMaterialCR
    /// </summary>
    public decimal? InstallerMaterialCR
    {
      get { return installerMaterialCR; }
      set { IsChanged |= installerMaterialCR != value; installerMaterialCR = value; }
    }

    /// <summary>
    /// Property relating to database column InstallerAcDR
    /// </summary>
    public decimal? InstallerAcDR
    {
      get { return installerAcDR; }
      set { IsChanged |= installerAcDR != value; installerAcDR = value; }
    }

    /// <summary>
    /// Property relating to database column DealerAcDR
    /// </summary>
    public decimal? DealerAcDR
    {
      get { return dealerAcDR; }
      set { IsChanged |= dealerAcDR != value; dealerAcDR = value; }
    }

    /// <summary>
    /// Property relating to database column DealerAcCR
    /// </summary>
    public decimal? DealerAcCR
    {
      get { return dealerAcCR; }
      set { IsChanged |= dealerAcCR != value; dealerAcCR = value; }
    }

    /// <summary>
    /// Property relating to database column DealerDipositCR
    /// </summary>
    public decimal? DealerDipositCR
    {
      get { return dealerDipositCR; }
      set { IsChanged |= dealerDipositCR != value; dealerDipositCR = value; }
    }

    /// <summary>
    /// Property relating to database column SimranAcCR
    /// </summary>
    public decimal? SimranAcCR
    {
      get { return simranAcCR; }
      set { IsChanged |= simranAcCR != value; simranAcCR = value; }
    }

    /// <summary>
    /// Property relating to database column SimranAcDR
    /// </summary>
    public decimal? SimranAcDR
    {
      get { return simranAcDR; }
      set { IsChanged |= simranAcDR != value; simranAcDR = value; }
    }

    /// <summary>
    /// Property relating to database column SimranMarginCR
    /// </summary>
    public decimal? SimranMarginCR
    {
      get { return simranMarginCR; }
      set { IsChanged |= simranMarginCR != value; simranMarginCR = value; }
    }

    #endregion  
  }

}
